package com.ss.android.article.browser.setting;

import android.app.Dialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.support.design.a;
import android.text.TextUtils;
import android.view.View.OnClickListener;
import android.view.View;

final class q implements View.OnClickListener {
    private final SettingActivity c;
    private final Dialog a;
    private final boolean b;

    q(SettingActivity arg1, Dialog arg2, boolean arg3) {
        this.c = arg1;
        this.a = arg2;
        this.b = arg3;

    }

    public final void onClick(View arg6) {
        this.a.dismiss();
        if(this.b) {
            SettingActivity v0 = this.c;
            try {
                Intent v1 = new Intent();
                v1.setAction("android.intent.action.VIEW");
                v1.putExtra("set_browser_congratulation", "set_browser_congratulation");
                v1.addCategory("android.intent.category.DEFAULT");
                v1.setData(Uri.parse("http://lemon_browser_setting"));
                v1.addFlags(67108864);
                v1.setComponent(new ComponentName("android", "com.android.internal.app.ResolverActivity"));
                ((Context)v0).startActivity(v1);
            }
            catch(Exception v0_1) {
                v0_1.printStackTrace();
            }

            return;
        }

        SettingActivity v1_1 = this.c;
        if(android.support.design.a.s != null && !android.support.design.a.s.isEmpty()) {
            String v0_2 = ((ResolveInfo)android.support.design.a.s.get(0)).activityInfo.packageName;
            if(TextUtils.isEmpty(((CharSequence)v0_2))) {
                return;
            }

            Intent v2 = new Intent();
            v2.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");
            v2.setData(Uri.fromParts("package", v0_2, null));
            ((Context)v1_1).startActivity(v2);
        }
    }
}

